//
//  Order_Cell.m
//  pz_live
//
//  Created by caiyc on 2018/9/17.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "Order_Cell.h"

@implementation Order_Cell
- (IBAction)handel:(UIButton *)sender {
    
   // [WToast showWithText:@"正在建设中"];
    self.handels();
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.handle_Btn.layer.cornerRadius = 5;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    // Initialization code
}


-(void)bindData:(NSDictionary *)dic {
    NSDictionary *dics = [NSDictionary changeType:dic];
    NSURL *url = [NSURL URLWithString:dics[@"goods_thumb"]];
    [self.image sd_setImageWithURL:url];
    self.name.text = dics[@"goods_title"];
    self.ship_Name.text = [NSString stringWithFormat:@"快递公司：%@",dics[@"express_company"]];
    self.ship_Num.text = [NSString stringWithFormat:@"运单号：%@",dics[@"express_sn"]];
    NSURL *logo = [NSURL URLWithString:dics[@"store_logo"]];
    [self.logo sd_setImageWithURL:logo];
    self.order_status.text = [NSString stringWithFormat:@"订单号：%@",dic[@"ordersn"]];
    self.orderTime.text = [NSString stringWithFormat:@"%@",[XTool timeFrommartTotimeintral:dic[@"addtime"]]];
    self.price.text = [NSString stringWithFormat:@"¥%@",dic[@"price"]];
    [self.handle_Btn setTitle:@"联系客服" forState:UIControlStateNormal];
    self.status_Des.text = dic[@"status_cn"];
    
    self.applyCompany.text = [dic[@"supplier_store_name"]isEqualToString:@""]?@"无":dic[@"supplier_store_name"];
    NSString *str = @"联系客服";
    switch ([dic[@"status"] integerValue]) {
        case GuestOrderType_WZF:
            str = @"去付款";
             [self.handle_Btn setTitle:str forState:UIControlStateNormal];
            break;
        case GuestOrderType_YZF:
            str = @"确认收货";
             [self.handle_Btn setTitle:str forState:UIControlStateNormal];
            break;
        case GuestOrderType_YFH:
            self.handle_Btn.hidden = 1;
            break;
        case GuestOrderType_YSH:
            self.handle_Btn.hidden = 1;
            break;
        case GuestOrderType_SQTH:
            self.handle_Btn.hidden = 1;
            break;
        case GuestOrderType_DPJ:
            self.handle_Btn.hidden = 1;
            break;
        default:
            break;
    }
   
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
